package com.candy.dao.Impl;

import com.candy.dao.AccountDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class AccountDaoImpl implements AccountDao {
    @Autowired
    JdbcTemplate jdbcTemplate;

    @Override
    public void innerMoney(String innerName, int money) {

        jdbcTemplate.update("update accountCard set money=money+? where accountName=?",money,innerName);
    }

    @Override
    public void outterMoney(String outtername, int money) {
        jdbcTemplate.update("update accountCard set money=money-? where accountName=?",money,outtername);
    }
}
